package abstractfactory02;

import org.junit.Test;

/**
 * Created by Administrator on 2017/1/8.
 */
public class AbstractFactoryTest {
    @Test
    public void test() {
        Factory sfactory = FactoryProducer.getFactory("SHAPE");
        Shape circle = sfactory.createShape("CIRCLE");
        circle.draw();
        Factory cFactory = FactoryProducer.getFactory("COLOR");
        Color red = cFactory.createColor("RED");
        red.fill();
    }

}
